package com.iris.live.services.data.repositories;

import com.iris.live.services.data.models.CrmComplaintModel;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by 37966 on 2016/11/17.
 */
@Transactional
public interface CrmComplaintRepository extends JpaRepository<CrmComplaintModel, Integer>, JpaSpecificationExecutor<CrmComplaintModel> {

    @Query("select a from CrmComplaintModel a where a.permit=?1 and a.custId=?2")
    List<CrmComplaintModel> getComplaintByPermitAndCustId(String permit, Integer custId);
}
